{% set namespace = "AWS/SNS" %}
{% set dff_api_title = "AWS-SNS Collection" %}
{% set dff_api_crontab = "* * * * *" %}

{% extends "base_template" %}
{% block import %}
{{ super() }}
import integration_aws_cloudwatch__main as monitor_main
{% endblock %}

{% block account %}
{{ super() }}
{% endblock %}

{% block collect_configs %}
monitor_configs = {
    'regions': {{ repr(collector.regions) }},
    'targets': [
        {
            'namespace': {{ repr(namespace) }},
            {% if collector.dimensions %}
            {% set dimensions = collector.dimensions.split(',') %}
            'dimensions': {{ repr(dimensions) }},
            {% endif %}
            {% if collector.metrics %}
            'metrics'  : {{ repr(collector.metrics) }}
            {% else %}
            'metrics'  : []
            {% endif %}
        }
    ]
}
{% endblock %}

{% block filters%}
{% endblock %}

{% block run %}
@DFF.API('{{ dff_api_title }}', timeout=300, fixed_crontab='{{ dff_api_crontab }}')
def run():
    collectors = [
        monitor_main.DataCollector(account, monitor_configs)
    ]
    Runner(collectors).run()
{% endblock %}
